<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>品牌修改</title>
    <css file="__STATIC__/hdjs/hdui.css"/>
    <css file="__STATIC__/bootstrap/css/bootstrap.min.css"/>
    <!-- 载入uploadify插件-->
    <js file="__STATIC__/jquery/jquery-1.7.2.min.js"/>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <link href="__STATIC__/uploadify/uploadify.css" type="text/css" rel="stylesheet"></link>
    <style type="text/css">

    .hd-h70{
        width: 80px;
        height: 60px;
    }
    #uploadList ul li{
        float: left;
    }
    </style>

    <script type="text/javascript">
        $(function() {
            $('#file').uploadify({
                'formData'     : {//POST数据
                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
                },
                'fileTypeDesc' : '*.png;*.gif;*.jpg',//上传描述
                'fileTypeExts' : '*.png;*.gif;*.jpg',
                'swf'      : '__STATIC__/uploadify/uploadify.swf',
                'uploader' : '{|U:"upload"}',
                'buttonText':'选择图片',
                'fileSizeLimit' : '2000KB',

                'uploadLimit' : 1,//上传文件数
                'width':65,
                'height':25,
                'successTimeout':10,//等待服务器响应时间
                'removeTimeout' : 0.2,//成功显示时间
                'onUploadSuccess' : function(file, data, response){
                    data=$.parseJSON(data);
                    var imageUrl = data.image?data.url:'__STATIC__/image/default.png';
                    var li="<li path='"+data.path+"' url='"+data.url+"'><img src='"+imageUrl+"' class='hd-w80 hd-h70'/></li>";
                    $("#uploadList ul").prepend(li);
                    $("#logo").val(data.logo);
                }
            });
        });
    </script>
</head>
<body>
<div class="wrap">
    <div class="title-header">修改品牌信息</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="table1">

      
            <tr>
                <th class="w100">品牌名称</th>
                <td>
                    <input type="text" name="name" class="w200" value="{$oldData.name}"/>
                </td>
                
            </tr>
           
            <tr>
                <th class="w100">logo</th>
                <td width="200">
                    <div lab="uploadFile">
                                <input id="file" type="file" multiple="true">
                                <span>类型: *.jpg,*.png 大小: 2000KB 数量: 10</span>                            
                            </div>
                    
                </td>
                <td>
                    <div id="uploadList">          
                        <ul> 
                                
                        </ul>
                    </div>
                
                 </td>
            </tr>
             <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="cid" class="w200">
                        <foreach from="$data" key="$k" value="$v">
                            <option value="{$v.cid}" <if value="$v.cid==$oldData.cid">selected</if>>{$v.cname}</option>
                        </foreach>
                    </select>
                </td>
                <td></td>
            </tr>
            
            <tr>
                <th class="w100">排序</th>
                <td>
                    <input type="text" name="sort" class="w200" value="{$oldData.sort}"/>
                </td>
                <td>请填写1到65535的排序数字 </td>
            </tr>
            
            
             <tr>
                <th class="w100">是否热门</th>
                <td>
                    是：<input type="radio" name="is_show" id="" <if value="$oldData.is_show==1">checked="checked" </if> value="1"/>
                    &nbsp;
                    否: <input type="radio" name="is_show" id=""  <if value="$oldData.is_show==0">checked="checked" </if> value="0"/>
                </td>
                <td></td>
            </tr>
                  
        </table>
        <div class="position-bottom">
            <!-- 链接原有logo -->
            <input type="hidden" id="logo" name="logo" value="{$oldData.logo}"/>
            <input type="submit" class="hd-success" value="修改"/>
        </div>
    </form>
</div>
</body>
</html>